  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
   *  Allgemeine Erweiterungen des JS String-Objekts   
   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */  
  
	/** TRIM 
	* Quelle: http://forum.de.selfhtml.org/archiv/2005/4/t106433/#m659975
	**/     
	String.prototype.leftTrim = function () {
	return (this.replace(/^\s+/,""));
	};
	String.prototype.rightTrim = function () {
	return (this.replace(/\s+$/,""));
	};
	//kombiniert "leftTrim" und "rightTrim";
	String.prototype.basicTrim = function () {
	return (this.replace(/\s+$/,"").replace(/^\s+/,""));
	};
	String.prototype.trim = function () {
	return (this.replace(/\s+$/,"").replace(/^\s+/,""));
	};
	//dampft leerzeichen(-sequenzen) innerhalb einer zeichenkette auf ein einzelnes "space" ein;
	String.prototype.superTrim = function () {
	return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""));
	};

	//zugabe: entfernt alle leerzeichen aus einer zeichenkette;
	String.prototype.removeWhiteSpaces = function () {
	return (this.replace(/\s+/g,""));
	};

	 
	String.prototype.reverse = function() {
		var res = "";
		for (var i = this.length; i > 0; --i) {
			res += this.charAt(i - 1);
		}
		return res;
	}

	String.leftPad = function (val, size, ch) {
		var result = new String(val);
		if (ch == null) {
			ch = " ";
		}
		while (result.length < size) {
			result = ch + result;
		}
		return result;
	}

	String.escape = function(string) {
		return string.replace(/('|\\)/g, "\\$1");
	}
